3.154 \(\int \frac{\cos (c+d x)}{a \cos (c+d x)+i a \sin (c+d x)} \, dx\)

Optimal. Leaf size=46 \[ \frac{x}{2 a}+\frac{i \cos (c+d x)}{2 d (a \cos (c+d x)+i a \sin (c+d x))} \]

[Out]

x/(2*a) + ((I/2)*Cos[c + d*x])/(d*(a*Cos[c + d*x] + I*a*Sin[c + d*x]))

________________________________________________________________________________________

Rubi [A]  time = 0.0294502, antiderivative size = 46, normalized size of antiderivative = 1., number of steps used = 2, number of rules used = 2, integrand size = 29, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.069, Rules used = {3082, 8} \[ \frac{x}{2 a}+\frac{i \cos (c+d x)}{2 d (a \cos (c+d x)+i a \sin (c+d x))} \]

Antiderivative was successfully verified.

[In]

Int[Cos[c + d*x]/(a*Cos[c + d*x] + I*a*Sin[c + d*x]),x]

[Out]

x/(2*a) + ((I/2)*Cos[c + d*x])/(d*(a*Cos[c + d*x] + I*a*Sin[c + d*x]))

Rule 3082

Int[cos[(c_.) + (d_.)*(x_)]^(m_.)*(cos[(c_.) + (d_.)*(x_)]*(a_.) + (b_.)*sin[(c_.) + (d_.)*(x_)])^(n_), x_Symb
ol] :> -Simp[(b*(a*Cos[c + d*x] + b*Sin[c + d*x])^n)/(2*a*d*n*Cos[c + d*x]^n), x] + Dist[1/(2*a), Int[(a*Cos[c
 + d*x] + b*Sin[c + d*x])^(n + 1)/Cos[c + d*x]^(n + 1), x], x] /; FreeQ[{a, b, c, d}, x] && EqQ[m + n, 0] && E
qQ[a^2 + b^2, 0] && LtQ[n, 0]

Rule 8

Int[a_, x_Symbol] :> Simp[a*x, x] /; FreeQ[a, x]

Rubi steps

\begin{align*} \int \frac{\cos (c+d x)}{a \cos (c+d x)+i a \sin (c+d x)} \, dx &=\frac{i \cos (c+d x)}{2 d (a \cos (c+d x)+i a \sin (c+d x))}+\frac{\int 1 \, dx}{2 a}\\ &=\frac{x}{2 a}+\frac{i \cos (c+d x)}{2 d (a \cos (c+d x)+i a \sin (c+d x))}\\ \end{align*}

Mathematica [A]  time = 0.0679494, size = 38, normalized size = 0.83 \[ \frac{2 (c+d x)+\sin (2 (c+d x))+i \cos (2 (c+d x))}{4 a d} \]

Antiderivative was successfully verified.

[In]

Integrate[Cos[c + d*x]/(a*Cos[c + d*x] + I*a*Sin[c + d*x]),x]

[Out]

(2*(c + d*x) + I*Cos[2*(c + d*x)] + Sin[2*(c + d*x)])/(4*a*d)

________________________________________________________________________________________

Maple [A]  time = 0.098, size = 59, normalized size = 1.3 \begin{align*}{\frac{-{\frac{i}{4}}\ln \left ( \tan \left ( dx+c \right ) -i \right ) }{ad}}+{\frac{1}{2\,ad \left ( \tan \left ( dx+c \right ) -i \right ) }}+{\frac{{\frac{i}{4}}\ln \left ( \tan \left ( dx+c \right ) +i \right ) }{ad}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(cos(d*x+c)/(a*cos(d*x+c)+I*a*sin(d*x+c)),x)

[Out]

-1/4*I/a/d*ln(tan(d*x+c)-I)+1/2/a/d/(tan(d*x+c)-I)+1/4*I/a/d*ln(tan(d*x+c)+I)

________________________________________________________________________________________

Maxima [F(-2)]  time = 0., size = 0, normalized size = 0. \begin{align*} \text{Exception raised: RuntimeError} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(d*x+c)/(a*cos(d*x+c)+I*a*sin(d*x+c)),x, algorithm="maxima")

[Out]

Exception raised: RuntimeError

________________________________________________________________________________________

Fricas [A]  time = 0.459964, size = 86, normalized size = 1.87 \begin{align*} \frac{{\left (2 \, d x e^{\left (2 i \, d x + 2 i \, c\right )} + i\right )} e^{\left (-2 i \, d x - 2 i \, c\right )}}{4 \, a d} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(d*x+c)/(a*cos(d*x+c)+I*a*sin(d*x+c)),x, algorithm="fricas")

[Out]

1/4*(2*d*x*e^(2*I*d*x + 2*I*c) + I)*e^(-2*I*d*x - 2*I*c)/(a*d)

________________________________________________________________________________________

Sympy [A]  time = 0.544379, size = 61, normalized size = 1.33 \begin{align*} \begin{cases} \frac{i e^{- 2 i c} e^{- 2 i d x}}{4 a d} & \text{for}\: 4 a d e^{2 i c} \neq 0 \\x \left (\frac{\left (e^{2 i c} + 1\right ) e^{- 2 i c}}{2 a} - \frac{1}{2 a}\right ) & \text{otherwise} \end{cases} + \frac{x}{2 a} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(d*x+c)/(a*cos(d*x+c)+I*a*sin(d*x+c)),x)

[Out]

Piecewise((I*exp(-2*I*c)*exp(-2*I*d*x)/(4*a*d), Ne(4*a*d*exp(2*I*c), 0)), (x*((exp(2*I*c) + 1)*exp(-2*I*c)/(2*
a) - 1/(2*a)), True)) + x/(2*a)

________________________________________________________________________________________

Giac [A]  time = 1.14433, size = 81, normalized size = 1.76 \begin{align*} -\frac{\frac{i \, \log \left (\tan \left (d x + c\right ) - i\right )}{a} - \frac{i \, \log \left (-i \, \tan \left (d x + c\right ) + 1\right )}{a} + \frac{-i \, \tan \left (d x + c\right ) - 3}{a{\left (\tan \left (d x + c\right ) - i\right )}}}{4 \, d} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(d*x+c)/(a*cos(d*x+c)+I*a*sin(d*x+c)),x, algorithm="giac")

[Out]

-1/4*(I*log(tan(d*x + c) - I)/a - I*log(-I*tan(d*x + c) + 1)/a + (-I*tan(d*x + c) - 3)/(a*(tan(d*x + c) - I)))
/d